package com.app.bimo.commonbusiness.network;

import android.app.Application;
import android.util.Log;

import com.app.bimo.commonbusiness.base.IModuleInit;
import com.app.bimo.commonbusiness.util.Constant;
import com.app.bimo.commonbusiness.util.DataUtil;
import com.app.bimo.commonbusiness.util.SharedPreUtils;
import com.app.bimo.commonbusiness.util.SystemUtil;


public class BaseModuleInit implements IModuleInit {
    @Override
    public boolean onInitAhead(Application application) {
        return false;
    }

    @Override
    public boolean onInitLow(Application application) {
        RetrofitServiceManager.getInstance().addAllHead(Constant.HttpPhoneMEI, SystemUtil.getIMEI(application.getApplicationContext()));
        RetrofitServiceManager.getInstance().addAllHead(Constant.HttpPhoneBrand, SystemUtil.getPhoneBrand());
        RetrofitServiceManager.getInstance().addAllHead(Constant.HttpAppVer, SystemUtil.getVerName(application.getApplicationContext()));
//        RetrofitServiceManager.getInstance().addAllHead(Constant.HttpAppVer, "1.1.1");
        RetrofitServiceManager.getInstance().addAllHead(Constant.HttpPhoneSource, "android");
        String token = SharedPreUtils.getInstance(application.getApplicationContext()).getString(Constant.HttpToken);
        if (!DataUtil.isEmpty(token)) {
            RetrofitServiceManager.getInstance().addAllHead(Constant.HttpToken, token);
        }
        return false;
    }
}
